/* ==========================================================================
   Bulk Order Builder — stylesheet
   Contract: /CONTRACT-bulkorderbuilder.md (single source of truth for markup)
   Owner: Agent C

   Every rule in this file is scoped under .bob using a descendant
   combinator (.bob .bob-card, never a bare .bob-card) — the previous
   stylesheet in this project leaked a flat global prefix and that is
   exactly what this scoping avoids. Nothing here touches the site header /
   nav / utility bar / footer — those belong to _Layout.cshtml.

   A note on a few selectors that are NOT literally spelled out in the
   contract's markup (the contract gives exhaustive HTML for the product
   sheet / lines / option groups, but leaves the review table, issues-panel
   contents, confirm-popover internals, and the two modal shells to whatever
   Agent B/D render). Where I needed a hook that doesn't exist in the
   contract, I picked the smallest reasonable addition and called it out
   with a "NOT IN CONTRACT" comment at the point of use. See the final
   report for the full list.
   ========================================================================== */

/* ==========================================================================
   1. Tokens — the retheme surface. A client skin overrides this one block.
   ========================================================================== */
.bob {
  --bob-bg: #f8f9fa;
  --bob-surface: #fff;
  --bob-text: #212529;
  --bob-muted: #6c757d;
  --bob-border: #dee2e6;
  --bob-border-input: #ced4da;
  --bob-divider: #f1f3f5;

  --bob-primary: #0d6efd;
  --bob-primary-hover: #0b5ed7;
  --bob-primary-dark: #0a58ca;

  --bob-focus-border: #86b7fe;
  --bob-focus-ring: rgba(13, 110, 253, .25);

  --bob-success: #198754;
  --bob-danger: #dc3545;

  --bob-warn-bg: #fff3cd;
  --bob-warn-border: #ffecb5;
  --bob-warn-text: #664d03;

  --bob-flag-border: #ffc107;
  --bob-flag-bg: #fffbf0;

  --bob-row-open: #e7f1ff;
  --bob-row-open-hover: #d5e6ff;
  --bob-row-zebra: #fbfcfd;

  --bob-radius: .375rem;
  --bob-radius-lg: .5rem;

  --bob-shadow: 0 .125rem .25rem rgba(0, 0, 0, .055);
  --bob-shadow-modal: 0 .5rem 1rem rgba(0, 0, 0, .15);

  /* Not part of the contract's palette — a hairline overlay border used on
     the confirm popover and modal cards. Not themeable by design: it reads
     correctly against any surface color, so it stays a literal value
     instead of a token. */
  --bob-overlay-border: rgba(0, 0, 0, .2);
}

/* ==========================================================================
   2. Base / layout
   ========================================================================== */
.bob {
  display: block;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--bob-text);
  background: var(--bob-bg);
  padding: 24px 24px 56px;
  box-sizing: border-box;
}
.bob *,
.bob *::before,
.bob *::after {
  box-sizing: border-box;
}
.bob a {
  color: var(--bob-primary);
  text-decoration: none;
}
.bob a:hover {
  color: var(--bob-primary-dark);
  text-decoration: underline;
}
.bob button {
  font: inherit;
  color: inherit;
}
.bob input {
  font: inherit;
  color: inherit;
}

/* One column, two stages. The sheet gets the full width it always wanted;
   the review stage replaces it rather than competing for space beside it. */
.bob .bob-ws {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.bob[data-stage="build"] .bob-review-card { display: none; }
.bob[data-stage="review"] .bob-sheet-card,
.bob[data-stage="review"] .bob-ready { display: none; }

/* Horizontal-scroll wrappers shared by the sheet and the review table.
   Each card gives its own .bob-scroll-inner a different min-width. */
.bob .bob-scroll {
  overflow-x: auto;
  overflow-y: visible;
}
.bob .bob-sheet-card .bob-scroll-inner {
  min-width: 1040px;
}
.bob .bob-review-card .bob-scroll-inner {
  min-width: 980px;
}

/* ==========================================================================
   3. Title band
   ========================================================================== */
.bob .bob-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.bob .bob-crumb {
  font-size: 13px;
  color: var(--bob-muted);
  margin-bottom: 6px;
}
.bob .bob-crumb-sep {
  color: var(--bob-muted);
  padding: 0 2px;
}
.bob .bob-title {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
}
.bob .bob-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--bob-muted);
  max-width: 640px;
}
/* [hidden] must win over the badge's inline-flex, so the visible-state
   rule only fires while the attribute is absent. */
.bob .bob-saved-badge:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .35rem .65rem;
  font-size: 12px;
  font-weight: 600;
  color: var(--bob-success);
  background: rgba(25, 135, 84, .12);
  background: color-mix(in srgb, var(--bob-success) 14%, white);
  border: 1px solid rgba(25, 135, 84, .35);
  border: 1px solid color-mix(in srgb, var(--bob-success) 35%, white);
  border-radius: var(--bob-radius);
  white-space: nowrap;
}
.bob .bob-saved-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bob-success);
  display: block;
  flex: none;
}

/* ==========================================================================
   4. Cards (shared shell for the sheet card, review card, actions,
      summary — anything with class "bob-card")
   ========================================================================== */
.bob .bob-card {
  background: var(--bob-surface);
  border: 1px solid var(--bob-border);
  border-radius: var(--bob-radius-lg);
  box-shadow: var(--bob-shadow);
}
.bob .bob-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bob-bg);
  border-bottom: 1px solid var(--bob-border);
  border-radius: var(--bob-radius-lg) var(--bob-radius-lg) 0 0;
  flex-wrap: wrap;
}
.bob .bob-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.bob .bob-card-sub {
  font-size: 13px;
  color: var(--bob-muted);
  margin-top: 2px;
}

/* Filter pills — JS fills .bob-filters with .bob-chip buttons (see the
   chip rules in section 8). This block only owns the joined-strip layout. */
.bob .bob-filters {
  display: flex;
  flex-wrap: wrap;
}
.bob .bob-filters .bob-chip {
  border-radius: 0;
  margin-left: -1px;
  position: relative;
}
.bob .bob-filters .bob-chip:first-child {
  margin-left: 0;
  border-top-left-radius: var(--bob-radius);
  border-bottom-left-radius: var(--bob-radius);
}
.bob .bob-filters .bob-chip:last-child {
  border-top-right-radius: var(--bob-radius);
  border-bottom-right-radius: var(--bob-radius);
}
.bob .bob-filters .bob-chip[aria-pressed="true"] {
  z-index: 2;
}

/* ==========================================================================
   5. Sheet header + shared 5-column grid
      (.bob-sheet-head, .bob-prow-main, .bob-line-main all share this grid
      so their columns line up, per contract section 6.)
   ========================================================================== */
.bob .bob-sheet-head,
.bob .bob-prow-main,
.bob .bob-line-main {
  display: grid;
  grid-template-columns: minmax(320px, 1.7fr) minmax(0, 2fr) 96px 96px 116px;
  align-items: center;
}
.bob .bob-sheet-head > *,
.bob .bob-prow-main > *,
.bob .bob-line-main > * {
  padding-right: 8px;
}
.bob .bob-sheet-head > *:last-child,
.bob .bob-prow-main > *:last-child,
.bob .bob-line-main > *:last-child {
  padding-right: 0;
}

.bob .bob-sheet-head {
  padding: 0 16px;
  height: 38px;
  background: var(--bob-bg);
  border-bottom: 2px solid var(--bob-border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--bob-muted);
  font-weight: 600;
}

/* Numeric column utility, shared by the sheet header, product rows,
   employee lines, and the review table. */
.bob .bob-num {
  text-align: right;
  font-weight: 600;
}
.bob .bob-muted {
  font-weight: 400;
  color: var(--bob-muted);
}

/* ==========================================================================
   6. Product rows
   ========================================================================== */
.bob .bob-prow {
  border-bottom: 1px solid var(--bob-border);
}
.bob .bob-prow:last-child {
  border-bottom: 0;
}

.bob .bob-prow-main {
  padding: 10px 16px;
  cursor: pointer;
  background: var(--bob-surface);
  transition: background .12s ease;
}

/* Row colour carries one fact: is this product on the order?
   On the order  -> blue, whether open or closed, deepening on hover.
   Not on it     -> plain, greying on hover.
   aria-expanded is the accessible hook for the open/closed chevron state;
   data-empty (set by the JS) is what says whether the row has lines. */
.bob .bob-prow[data-empty="0"] .bob-prow-main {
  background: var(--bob-row-open);
}
.bob .bob-prow[data-empty="0"] .bob-prow-main:hover,
.bob .bob-prow[data-empty="0"] .bob-prow-main[aria-expanded="true"] {
  background: var(--bob-row-open-hover);
}
.bob .bob-prow[data-empty="1"] .bob-prow-main:hover,
.bob .bob-prow[data-empty="1"] .bob-prow-main[aria-expanded="true"] {
  background: var(--bob-bg);
}

.bob .bob-prow-id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.bob .bob-chev {
  display: inline-block;
  width: 12px;
  flex: none;
  color: var(--bob-muted);
  font-size: 11px;
  transition: transform .15s ease;
}
.bob .bob-prow-main[aria-expanded="true"] .bob-chev {
  transform: rotate(90deg);
}

.bob .bob-thumb {
  width: 56px;
  height: 56px;
  cursor: zoom-in;
  position: relative;
  flex: none;
  border: 1px solid var(--bob-border);
  border-radius: var(--bob-radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Diagonal placeholder pattern, visible behind a transparent/broken image */
  background: repeating-linear-gradient(135deg, var(--bob-divider) 0 5px, var(--bob-bg) 5px 10px);
}
.bob .bob-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bob .bob-prow-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--bob-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.bob .bob-prow-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 3px;
}
.bob .bob-sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--bob-muted);
  white-space: nowrap;
  flex: none;
}
.bob .bob-count {
  display: inline-block;
  padding: .25em .5em;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--bob-primary);
  border-radius: var(--bob-radius);
  white-space: nowrap;
  flex: none;
}

/* Category pill. Real category names are client catalogue data (the data
   island's data-cat, e.g. "CrudeFR") — these overrides are illustrative
   only, keyed off the design mock's sample categories plus one real
   example. Add/replace [data-cat="..."] rules per client; anything
   unmatched falls back to the neutral default just below. */
.bob .bob-cat {
  display: inline-block;
  padding: .2em .5em;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--bob-radius);
  white-space: nowrap;
  flex: none;
  color: var(--bob-muted);
  border: 1px solid var(--bob-muted);
}
.bob .bob-cat[data-cat="Apparel"],
.bob .bob-cat[data-cat="CrudeFR"] {
  color: var(--bob-primary);
  border-color: var(--bob-primary);
}
.bob .bob-cat[data-cat="Footwear"] {
  color: var(--bob-muted);
  border-color: var(--bob-muted);
}
.bob .bob-cat[data-cat="PPE"] {
  color: var(--bob-success);
  border-color: var(--bob-success);
}

/* Empty-product-row message ("No employees on this product yet.").
   NOT IN CONTRACT: no class is named for this in the markup skeleton;
   added the minimum needed to style it. */
.bob .bob-prow-empty {
  padding: 12px 16px 16px 58px;
  font-size: 13px;
  color: var(--bob-muted);
}

/* ==========================================================================
   7. Employee lines
   ========================================================================== */
.bob .bob-line {
  border-top: 1px solid var(--bob-divider);
  background: var(--bob-surface);
}
/* data-missing="1" is the only state the JS is allowed to set for this —
   selecting on the structural .bob-line class + the data attribute keeps
   the "js- classes are never styled" rule intact (both classes are always
   present together on this element per the contract). */
.bob .bob-line[data-missing="1"] {
  box-shadow: inset 3px 0 0 var(--bob-flag-border);
}

.bob .bob-line-main {
  padding: 8px 16px;
}
.bob .bob-line-id {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 22px;
  min-width: 0;
}
.bob .bob-line-arrow {
  color: var(--bob-muted);
  font-size: 12px;
  flex: none;
}

.bob .bob-name-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: .25rem .5rem;
  font-size: 13px;
  color: var(--bob-text);
  background: var(--bob-surface);
  border: 1px solid var(--bob-border-input);
  border-radius: var(--bob-radius);
  outline: none;
}
.bob .bob-line[data-missing="1"] .bob-name-input {
  border-color: var(--bob-flag-border);
  background: var(--bob-flag-bg);
}

.bob .bob-line-ops {
  position: relative;
  display: flex;
  flex: none;
}

.bob .bob-line-opts {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.bob .bob-line-summary {
  font-size: 13px;
  color: var(--bob-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bob .bob-qty {
  width: 66px;
  padding: .25rem .5rem;
  font-size: 13px;
  text-align: right;
  color: var(--bob-text);
  background: var(--bob-surface);
  border: 1px solid var(--bob-border-input);
  border-radius: var(--bob-radius);
  outline: none;
}

/* ==========================================================================
   8. Icon buttons + confirm popover
   ========================================================================== */
.bob .bob-iconbtn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid var(--bob-border-input);
  background: var(--bob-surface);
  color: var(--bob-muted);
  cursor: pointer;
  padding: 0;
  border-radius: var(--bob-radius);
  margin-left: -1px;
  position: relative;
}
.bob .bob-iconbtn:hover {
  background: var(--bob-bg);
}
.bob .bob-iconbtn-danger {
  color: var(--bob-danger);
}
/* "Armed" state, i.e. this button's confirm popover is open. Same
   aria-expanded idiom as the product-row toggle — the button controls a
   popover it is expanding, so that's the natural ARIA hook. */
.bob .bob-iconbtn[aria-expanded="true"] {
  background: var(--bob-muted);
  border-color: var(--bob-muted);
  color: #fff;
}
.bob .bob-iconbtn-danger[aria-expanded="true"] {
  background: var(--bob-danger);
  border-color: var(--bob-danger);
  color: #fff;
}

/* Confirm strip -- an inline, full-width sibling of the row, NOT a popover.
   .bob-scroll clips its overflow, so an absolutely-positioned bubble anchored
   to the icon strip was being cut off on the last line of a product. Inline
   also means it reflows on narrow viewports instead of escaping the card. */
.bob .bob-confirm {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 9px 16px 9px 58px;
  background: var(--bob-flag-bg);
  border-top: 1px solid var(--bob-flag-border);
  border-bottom: 1px solid var(--bob-flag-border);
}
/* Plain text inside the strip. This used to be the popover's titlebar, so it
   carried a grey fill, a bottom rule and rounded top corners -- all of which
   read as a stray pill once the popover became an inline strip. */
.bob .bob-confirm-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--bob-warn-text);
}
.bob .bob-confirm-actions {
  display: flex;
  gap: 6px;
}
.bob .bob-confirm-yes,
.bob .bob-confirm-no {
  padding: .2rem .6rem;
  font-size: 12.5px;
  border-radius: var(--bob-radius);
  cursor: pointer;
}
.bob .bob-confirm-yes {
  color: #fff;
  background: var(--bob-primary);
  border: 1px solid var(--bob-primary);
}
.bob .bob-confirm-no {
  color: var(--bob-muted);
  background: var(--bob-surface);
  border: 1px solid var(--bob-muted);
}
.bob .bob-confirm-no:hover {
  background: var(--bob-muted);
  color: #fff;
}
/* Delete's confirm turns its Yes button red, driven purely off the armed
   danger icon button — no extra markup/class needed. Degrades gracefully
   (stays primary-blue) in the rare browser without :has() support. */
/* The strip belongs to a line, and the armed icon button is its sibling, so
   the destructive styling can key off the row instead of needing :has(). */
.bob .js-bob-line:has(.bob-iconbtn-danger[aria-expanded="true"]) .bob-confirm-yes {
  background: var(--bob-danger);
  border-color: var(--bob-danger);
}

/* ==========================================================================
   9. Option editor + chip / swatch groups
   ========================================================================== */
.bob .bob-editor {
  margin: 0 16px 14px 58px;
  border: 1px solid var(--bob-border);
  border-radius: var(--bob-radius-lg);
  background: var(--bob-surface);
}
/* Head reads left to right: which line and what its options currently are,
   then a small note that picking is what saves. Both left-aligned -- the note
   used to sit right-aligned at body size and pulled the eye away from the
   title it was qualifying. */
.bob .bob-editor-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 10px 14px;
  background: var(--bob-bg);
  border-bottom: 1px solid var(--bob-border);
  border-radius: var(--bob-radius-lg) var(--bob-radius-lg) 0 0;
}
.bob .bob-editor-title {
  font-size: 14px;
  font-weight: 600;
}
.bob .bob-editor-hint {
  font-size: 11.5px;
  color: var(--bob-muted);
}
.bob .bob-editor-body {
  padding: 2px 14px 10px;
}
.bob .bob-editor-foot {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px;
  background: var(--bob-bg);
  border-top: 1px solid var(--bob-border);
  border-radius: 0 0 var(--bob-radius-lg) var(--bob-radius-lg);
}

.bob .bob-group {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--bob-divider);
}
.bob .bob-group:last-child {
  border-bottom: 0;
}
.bob .bob-group-name {
  font-size: 13px;
  font-weight: 600;
}
.bob .bob-group-value {
  font-size: 12.5px;
  color: var(--bob-muted);
  margin-top: 1px;
}
.bob .bob-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Chips (size / size2 / non-color axes, and the filter pills above) */
.bob .bob-chip {
  padding: .25rem .6rem;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  border: 1px solid var(--bob-border-input);
  background: var(--bob-surface);
  color: var(--bob-text);
  border-radius: var(--bob-radius);
  cursor: pointer;
}
.bob .bob-chip:hover:not([disabled]):not([aria-pressed="true"]) {
  background: var(--bob-bg);
}
.bob .bob-chip[aria-pressed="true"] {
  font-weight: 600;
  border-color: var(--bob-primary);
  background: var(--bob-primary);
  color: #fff;
}
.bob .bob-chip[disabled] {
  cursor: not-allowed;
  font-weight: 400;
  color: var(--bob-muted);
  background: var(--bob-divider);
  border-color: var(--bob-border);
}

/* Swatches (color axis) */
.bob .bob-swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: var(--bob-radius);
  background: var(--swatch);
  border: 1px solid var(--bob-overlay-border);
  cursor: pointer;
  box-shadow: none;
}
.bob .bob-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--bob-primary);
}
.bob .bob-swatch[disabled] {
  cursor: not-allowed;
  opacity: .35;
  filter: grayscale(.4);
}

/* ==========================================================================
   10. Review table
      NOT IN CONTRACT: the markup skeleton only gives an empty
      .js-bob-review fill target. .bob-review-head / .bob-review-row /
      .bob-review-name / .bob-review-empty are this file's proposal for
      the table Agent D renders into it, using the 4-column grid from
      contract section 6.
   ========================================================================== */
.bob .bob-review-head,
.bob .bob-review-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) minmax(130px, .9fr) minmax(200px, 1.4fr) 70px 90px 110px;
  align-items: center;
  padding: 0 16px;
}
.bob .bob-review-head > *,
.bob .bob-review-row > * {
  padding-right: 8px;
}
.bob .bob-review-head > *:last-child,
.bob .bob-review-row > *:last-child {
  padding-right: 0;
}


.bob .bob-review-head {
  height: 36px;
  border-bottom: 2px solid var(--bob-border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--bob-muted);
  font-weight: 600;
}
.bob .bob-review-row {
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bob-divider);
  background: var(--bob-surface);
}
/* Contract: "zebra striping ... on odd rows" (1-indexed). */
.bob .bob-review-row:nth-child(odd) {
  background: var(--bob-row-zebra);
}
.bob .bob-review-name {
  font-size: 13.5px;
  font-weight: 600;
}
.bob .bob-review-config {
  font-size: 12.5px;
  color: var(--bob-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bob .bob-review-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--bob-muted);
}

/* ==========================================================================
   11. Rail / summary
   ========================================================================== */
.bob .bob-sum-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid var(--bob-divider);
}
.bob .bob-sum-row span:first-child {
  color: var(--bob-muted);
}
.bob .bob-sum-row span:last-child {
  font-weight: 600;
}
.bob .bob-sum-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 16px;
  background: var(--bob-bg);
  border-radius: 0 0 var(--bob-radius-lg) var(--bob-radius-lg);
}
.bob .bob-sum-total span:first-child {
  font-weight: 600;
}
.bob .bob-sum-total span:last-child {
  font-size: 22px;
  font-weight: 700;
}

.bob .bob-progress {
  margin-top: 8px;
  padding: .5rem .75rem;
  font-size: 13px;
  text-align: center;
  color: var(--bob-text);
  background: var(--bob-bg);
  border: 1px solid var(--bob-border);
  border-radius: var(--bob-radius);
}

/* ==========================================================================
   12. Issues panel
   ========================================================================== */
.bob .bob-issues {
  background: var(--bob-warn-bg);
  border: 1px solid var(--bob-warn-border);
  border-radius: var(--bob-radius-lg);
  padding: 12px 16px;
  color: var(--bob-warn-text);
}
/* NOT IN CONTRACT: only the outer .bob-issues/.js-bob-issues container is
   named. .bob-issues-title / .bob-issues-list / .bob-issue are this
   file's proposal for the heading and per-issue rows the JS renders. */
.bob .bob-issues-title {
  font-weight: 600;
  font-size: 14px;
}
.bob .bob-issues-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bob .bob-issue {
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 13px;
  color: var(--bob-warn-text);
  line-height: 1.45;
  cursor: pointer;
  text-decoration: underline;
}
.bob .bob-issue:hover {
  color: var(--bob-text);
}

/* ==========================================================================
   13. Modals
      NOT IN CONTRACT: section 5 names the two behaviour hooks
      (js-bob-modal-checkout / js-bob-modal-quote) and describes the
      required visual (fixed overlay, centred 500px card) but the XSLT
      shell markup itself isn't reproduced here. .bob-modal-overlay /
      .bob-modal-dialog / .bob-modal-head / .bob-modal-title /
      .bob-modal-close / .bob-modal-body / .bob-modal-foot and the
      .bob-field-* form classes are this file's proposal — align with
      whatever Agent B actually emits.
   ========================================================================== */
.bob .bob-modal-overlay:not([hidden]) {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 80;
  padding: 48px 16px;
  overflow: auto;
}
.bob .bob-modal-dialog {
  background: var(--bob-surface);
  border: 1px solid var(--bob-overlay-border);
  border-radius: var(--bob-radius-lg);
  box-shadow: var(--bob-shadow-modal);
  width: 500px;
  max-width: 100%;
}
.bob .bob-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--bob-border);
}
.bob .bob-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}
.bob .bob-modal-close {
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #000;
  opacity: .5;
  cursor: pointer;
  padding: 0;
}
.bob .bob-modal-close:hover {
  opacity: .85;
}
.bob .bob-modal-body {
  padding: 16px;
  color: var(--bob-text);
}
.bob .bob-modal-body p {
  margin: 0 0 4px;
}
.bob .bob-modal-body p:last-child {
  margin-bottom: 0;
  font-size: 13px;
  color: var(--bob-muted);
}
.bob .bob-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--bob-border);
  flex-wrap: wrap;
}

/* Quote-modal form fields */
.bob .bob-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.bob .bob-field:last-child {
  margin-bottom: 0;
}
.bob .bob-field-label {
  font-size: 14px;
  font-weight: 500;
}
.bob .bob-field-optional {
  color: var(--bob-muted);
  font-weight: 400;
}
.bob .bob-field-input {
  width: 100%;
  padding: .375rem .75rem;
  font-size: 14px;
  color: var(--bob-text);
  background: var(--bob-surface);
  border: 1px solid var(--bob-border-input);
  border-radius: var(--bob-radius);
  outline: none;
}
.bob .bob-field-input[aria-invalid="true"] {
  border-color: var(--bob-danger);
}
.bob .bob-field-error {
  font-size: 13px;
  color: var(--bob-danger);
}

/* ==========================================================================
   14. Buttons
   ========================================================================== */
.bob .bob-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: .5rem 1rem;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--bob-radius);
  cursor: pointer;
  background: var(--bob-surface);
  color: var(--bob-text);
}
.bob .bob-btn[disabled] {
  cursor: not-allowed;
  opacity: .65;
}

.bob .bob-btn-primary {
  color: #fff;
  background: var(--bob-primary);
  border-color: var(--bob-primary);
}
.bob .bob-btn-primary:hover:not([disabled]) {
  background: var(--bob-primary-hover);
  border-color: var(--bob-primary-dark);
}

.bob .bob-btn-success {
  color: #fff;
  background: var(--bob-success);
  border-color: var(--bob-success);
}
.bob .bob-btn-success:hover:not([disabled]) {
  background: color-mix(in srgb, var(--bob-success) 85%, black);
  border-color: color-mix(in srgb, var(--bob-success) 85%, black);
}

.bob .bob-btn-outline {
  color: var(--bob-primary);
  background: var(--bob-surface);
  border-color: var(--bob-primary);
}
.bob .bob-btn-outline:hover:not([disabled]) {
  background: var(--bob-primary);
  color: #fff;
}

.bob .bob-btn-xs {
  padding: .2rem .55rem;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--bob-text);
  background: var(--bob-surface);
  border-color: var(--bob-border-input);
}
.bob .bob-btn-xs:hover:not([disabled]) {
  background: var(--bob-bg);
}

.bob .bob-btn-add {
  padding: .25rem .5rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--bob-primary);
  background: var(--bob-surface);
  border-color: var(--bob-primary);
}
.bob .bob-btn-add:hover:not([disabled]) {
  background: var(--bob-primary);
  color: #fff;
}

/* ==========================================================================
   15. Data island
   ========================================================================== */
.bob .bob-data {
  display: none;
}

/* ==========================================================================
   16. Focus visibility — every input and button. Text inputs get the ring
      on plain :focus (mouse or keyboard); buttons/links use :focus-visible
      so a mouse click doesn't ring a button but Tab always does.
   ========================================================================== */
.bob input:focus,
.bob select:focus,
.bob textarea:focus {
  outline: none;
  border-color: var(--bob-focus-border);
  box-shadow: 0 0 0 .2rem var(--bob-focus-ring);
}
.bob button:focus-visible,
.bob a:focus-visible {
  outline: none;
  border-color: var(--bob-focus-border);
  box-shadow: 0 0 0 .2rem var(--bob-focus-ring);
}
/* Swatches already use box-shadow for the selection ring — layer the focus
   ring on top instead of replacing it, so a focused+selected swatch shows
   both states. */
.bob .bob-swatch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 .2rem var(--bob-focus-ring), 0 0 0 2px #fff, 0 0 0 4px var(--bob-primary);
}
.bob .bob-swatch[aria-pressed="true"]:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--bob-primary), 0 0 0 calc(4px + .2rem) var(--bob-focus-ring);
}

/* ==========================================================================
   17. Responsive
   ========================================================================== */
/* The 1180px rail collapse is gone with the rail itself -- the workspace is a
   single column at every width now. What still needs to give on narrow screens
   is the build-stage foot, so the running total and the way forward stack
   instead of squeezing. */
@media (max-width: 720px) {
  .bob .bob-ready {
    align-items: stretch;
  }
  .bob .bob-ready-go {
    width: 100%;
  }
  .bob .bob-ready-facts {
    gap: 18px;
  }
}

@media (max-width: 760px) {
  .bob {
    padding-left: 12px;
    padding-right: 12px;
  }
}


/* ==========================================================================
   Empty product rows
   A product with nothing on the order is muted so the eye lands on the
   products that ARE on it. The Add line button keeps full contrast - the row
   is quiet, not disabled.
   ========================================================================== */
.bob .bob-prow[data-empty="1"] .bob-prow-name,
.bob .bob-prow[data-empty="1"] .bob-sku,
.bob .bob-prow[data-empty="1"] .bob-cat,
.bob .bob-prow[data-empty="1"] .bob-num,
.bob .bob-prow[data-empty="1"] .bob-thumb {
  opacity: .55;
}
.bob .bob-prow[data-empty="1"] .bob-prow-main:hover .bob-prow-name,
.bob .bob-prow[data-empty="1"] .bob-prow-main:hover .bob-sku,
.bob .bob-prow[data-empty="1"] .bob-prow-main:hover .bob-cat,
.bob .bob-prow[data-empty="1"] .bob-prow-main:hover .bob-num,
.bob .bob-prow[data-empty="1"] .bob-prow-main:hover .bob-thumb,
.bob .bob-prow[data-empty="1"] .bob-prow-main[aria-expanded="true"] .bob-prow-name,
.bob .bob-prow[data-empty="1"] .bob-prow-main[aria-expanded="true"] .bob-sku,
.bob .bob-prow[data-empty="1"] .bob-prow-main[aria-expanded="true"] .bob-cat,
.bob .bob-prow[data-empty="1"] .bob-prow-main[aria-expanded="true"] .bob-num,
.bob .bob-prow[data-empty="1"] .bob-prow-main[aria-expanded="true"] .bob-thumb {
  opacity: 1;
}

/* ==========================================================================
   14. Image viewer
   One shared, position:fixed panel appended to the .bob root -- NOT a popup
   nested in the row. .bob-scroll clips its overflow, which is exactly what
   cut off the old confirm popover, and an anchored image panel would hit the
   same wall. Fixed positioning escapes the scroller entirely.
   ========================================================================== */
.bob .bob-thumb::after {
  content: "";
  position: absolute;
  inset: auto 2px 2px auto;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(33, 37, 41, .62) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'><circle cx='4.2' cy='4.2' r='3' stroke='white' stroke-width='1.2'/><path d='M6.4 6.4 L9 9' stroke='white' stroke-width='1.2' stroke-linecap='round'/></svg>") center/10px 10px no-repeat;
  opacity: 0;
  transition: opacity .12s ease;
  pointer-events: none;
}
.bob .bob-prow-main:hover .bob-thumb::after,
.bob .bob-thumb:hover::after {
  opacity: 1;
}

.bob .bob-viewer {
  position: fixed;
  z-index: 90;
  width: 268px;
  padding: 10px;
  background: var(--bob-surface);
  border: 1px solid var(--bob-overlay-border);
  border-radius: var(--bob-radius-lg);
  box-shadow: var(--bob-shadow-modal);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bob .bob-viewer[hidden] {
  display: none;
}
.bob .bob-viewer-stage {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--bob-radius);
  background: repeating-linear-gradient(135deg, var(--bob-divider) 0 6px, var(--bob-bg) 6px 12px);
}
.bob .bob-viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.bob .bob-viewer-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}
.bob .bob-viewer-count {
  font-size: 11px;
  color: var(--bob-muted);
  font-weight: 400;
}
.bob .bob-viewer-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bob .bob-viewer-pick {
  width: 40px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--bob-surface);
  border: 1px solid var(--bob-border-input);
  border-radius: var(--bob-radius);
}
.bob .bob-viewer-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bob .bob-viewer-pick[aria-pressed="true"] {
  border-color: var(--bob-primary);
  box-shadow: 0 0 0 2px var(--bob-focus-ring);
}

/* ==========================================================================
   15. Clear controls + rail guidance
   ========================================================================== */
.bob .bob-titlebar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bob .bob-prow-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Quiet button: destructive-adjacent, so it stays recessive until hovered
   rather than competing with "+ Add line" beside it. */
.bob .bob-btn-quiet {
  color: var(--bob-muted);
  background: transparent;
  border: 1px solid transparent;
}
.bob .bob-btn-quiet:hover:not([disabled]) {
  color: var(--bob-danger);
  border-color: var(--bob-danger);
  background: var(--bob-surface);
}
.bob .bob-btn-quiet[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

/* Whole-order confirm sits between the title band and the sheet, full width. */
.bob .js-bob-clear-confirm:empty {
  display: none;
}
.bob .js-bob-clear-confirm .bob-confirm {
  margin-bottom: 20px;
  border: 1px solid var(--bob-flag-border);
  border-radius: var(--bob-radius-lg);
  padding-left: 16px;
}
.bob .bob-confirm-bulk .bob-confirm-head {
  flex: 1 1 auto;
}

.bob .bob-actions-note {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--bob-muted);
}

/* Collapsed-row digest: what is on this product without expanding it. */
.bob .bob-prow-lines {
  display: flex;
  flex-direction: column;
  gap: 1px;
  /* Sits beside the buttons, filling the rest of the options column, rather
     than stacked beneath them -- that middle space was empty on every
     collapsed row and the digest reads better aligned with the totals. */
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--bob-muted);
}
.bob .bob-prow-line,
.bob .bob-prow-more {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bob .bob-prow-line[data-missing="1"] {
  color: var(--bob-warn-text);
  font-weight: 600;
}
.bob .bob-prow-more {
  font-style: italic;
}
.bob .bob-prow-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}
.bob .bob-prow-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* Already-sent warning: this sheet is in the cart, sending again duplicates it. */
.bob .js-bob-sent-notice:empty {
  display: none;
}
.bob .bob-sent-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--bob-warn-text);
  background: var(--bob-warn-bg);
  border: 1px solid var(--bob-warn-border);
  border-radius: var(--bob-radius-lg);
}

/* ==========================================================================
   16. Build stage foot — running total and the one way forward
   ========================================================================== */
.bob .bob-ready {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--bob-surface);
  border: 1px solid var(--bob-border);
  border-radius: var(--bob-radius-lg);
  box-shadow: var(--bob-shadow);
}
.bob .bob-ready-empty {
  color: var(--bob-muted);
  font-size: 13px;
}
.bob .bob-ready-facts {
  display: flex;
  align-items: baseline;
  gap: 28px;
  flex-wrap: wrap;
}
.bob .bob-ready-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bob .bob-ready-k {
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--bob-muted);
  font-weight: 600;
}
.bob .bob-ready-v {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bob .bob-ready-go {
  font-size: 15px;
  padding: .6rem 1.4rem;
}

/* ==========================================================================
   17. Review stage — richer rows, and the only place the order can be sent
   ========================================================================== */
.bob .bob-review-product {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.bob .bob-thumb-sm {
  width: 40px;
  height: 40px;
  cursor: default;
}
.bob .bob-thumb-sm::after { content: none; }
.bob .bob-review-idtext { min-width: 0; }
.bob .bob-review-pname {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bob .bob-review-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.bob .bob-review-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: .15em .5em;
  font-size: 11.5px;
  border: 1px solid var(--bob-border);
  border-radius: var(--bob-radius);
  background: var(--bob-bg);
  white-space: nowrap;
}
.bob .bob-review-pill-k {
  color: var(--bob-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: 10px;
  font-weight: 600;
}
.bob .bob-review-pill-v { font-weight: 600; }
.bob .bob-review-name[data-missing="1"] {
  color: var(--bob-danger);
}

.bob .bob-review-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
  padding: 16px;
  border-top: 2px solid var(--bob-border);
  background: var(--bob-bg);
  border-radius: 0 0 var(--bob-radius-lg) var(--bob-radius-lg);
}
.bob .bob-review-foot .bob-sum-row,
.bob .bob-review-foot .bob-sum-total {
  padding-left: 0;
  padding-right: 0;
  background: transparent;
}
.bob .bob-review-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bob .bob-review-actions .bob-actions-note {
  margin-bottom: 4px;
}
@media (max-width: 860px) {
  .bob .bob-review-foot { grid-template-columns: minmax(0, 1fr); }
}
